﻿<Window x:Class="GetCarInfo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="499" Width="658" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:GetCarInfo" Loaded="Window_Loaded" Closing="Window_Closing">
    <Window.Resources>
        <CollectionViewSource x:Key="carInfoesViewSource" d:DesignSource="{d:DesignInstance my:CarInfo, CreateList=True}" />
        <my:RevertConvert x:Key="RevertConvert1" />
    </Window.Resources>
    <Grid DataContext="{StaticResource carInfoesViewSource}">
        <Button Content="检索" Height="23" HorizontalAlignment="Left" Margin="463,100,0,0" Name="btnSearch" VerticalAlignment="Top" Width="75" Foreground="Green" Click="btnSearch_Click" />
        <Label Content="类型" Height="31" HorizontalAlignment="Left" Margin="55,37,0,0" Name="label1" VerticalAlignment="Top" Foreground="Green" Width="40" FontSize="16" />
        <Label Content="价位" FontSize="16" Foreground="Green" Height="31" HorizontalAlignment="Left" Margin="344,37,0,0" Name="label2" VerticalAlignment="Top" Width="40" />
        <ComboBox Height="23" HorizontalAlignment="Left" Margin="136,45,0,0" Name="comBKind" VerticalAlignment="Top" Width="120" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" SelectedIndex="0" Text="ALL">
            <ComboBoxItem Content="ALL" />
        </ComboBox>
        <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,45,98,0" Name="comBPrise" VerticalAlignment="Top" Width="120" HorizontalContentAlignment="Center" BorderThickness="1" Opacity="1" Grid.Column="0" Text="" SelectedIndex="0">
            <ComboBoxItem Content="ALL" IsSelected="True" />
            <ComboBoxItem Content="10以下" />
            <ComboBoxItem Content="10~20" />
            <ComboBoxItem Content="20~30" />
            <ComboBoxItem Content="30~40" />
            <ComboBoxItem Content="40~50" />
            <ComboBoxItem Content="50~60" />
            <ComboBoxItem Content="60~70" />
            <ComboBoxItem Content="70~80" />
            <ComboBoxItem Content="80~90" />
            <ComboBoxItem Content="90~100" />
            <ComboBoxItem Content="100以上" />
        </ComboBox>
        <Button Content="更新" Foreground="Green" Height="23" HorizontalAlignment="Left" Margin="284,100,0,0" Name="btnUpdate" VerticalAlignment="Top" Width="75" Click="btnUpdate_Click" />
        <DataGrid AutoGenerateColumns="False" EnableRowVirtualization="True" Height="273" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="34,152,0,0" Name="carInfoesDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="523">
            <DataGrid.Columns>
                <DataGridTextColumn x:Name="car_NameAColumn" Binding="{Binding Path=car_NameA}" Header="car Name A" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="car_NameBColumn" Binding="{Binding Path=car_NameB}" Header="car Name B" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="car_NameCColumn" Binding="{Binding Path=car_NameC}" Header="car Name C" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="car_NameDColumn" Binding="{Binding Path=car_NameD}" Header="car Name D" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="car_PriceColumn" Binding="{Binding Path=car_Price}" Header="car Price" Width="SizeToHeader" />
                <DataGridTemplateColumn x:Name="car_PictureColumn" Header="car Picture" Width="SizeToHeader">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding Path=car_Picture}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        <Button Content="取消" Foreground="Green" Height="23" HorizontalAlignment="Right" Margin="0,100,196,0" Name="btnCancel" VerticalAlignment="Top" Width="75" IsEnabled="{Binding ElementName=btnUpdate, Path=IsEnabled, Converter={StaticResource RevertConvert1}}" Click="btnCancel_Click" IsDefault="False" />
    </Grid>
</Window>
